.class public Lcom/glympse/platform/common/Place;
.super Ljava/lang/Object;
.source "Place.java"


# instance fields
.field public m_dLatitude:D

.field public m_dLongitude:D

.field public m_strName:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 2

    .prologue
    const-wide/16 v0, 0x0

    .line 26
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    iput-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    .line 22
    iput-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    .line 23
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    .line 28
    return-void
.end method

.method public constructor <init>(Lcom/glympse/platform/common/Place;)V
    .locals 2
    .parameter "oPlace"

    .prologue
    const-wide/16 v0, 0x0

    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    iput-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    .line 22
    iput-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    .line 23
    const-string v0, ""

    iput-object v0, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    .line 33
    iget-wide v0, p1, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    iput-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    .line 34
    iget-wide v0, p1, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    iput-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    .line 35
    iget-object v0, p1, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    iput-object v0, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    .line 36
    return-void
.end method


# virtual methods
.method public HasLocation()Z
    .locals 4

    .prologue
    const-wide/16 v2, 0x0

    .line 47
    iget-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    cmpl-double v0, v2, v0

    if-nez v0, :cond_0

    iget-wide v0, p0, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    cmpl-double v0, v2, v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public Parse(Lcom/glympse/platform/GVector$NameValueNodes;)V
    .locals 5
    .parameter

    .prologue
    .line 54
    .local p1, listNameValues:Lcom/glympse/platform/GVector$NameValueNodes;,"Lcom/glympse/platform/GVector$NameValueNodes;"
    invoke-virtual {p1}, Lcom/glympse/platform/GVector$NameValueNodes;->elements()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, iter:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v3

    if-nez v3, :cond_1

    .line 94
    return-void

    .line 56
    :cond_1
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/glympse/platform/common/NameValueNode;

    .line 59
    .local v2, oNodeCur:Lcom/glympse/platform/common/NameValueNode;
    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_0

    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    if-eqz v3, :cond_0

    .line 65
    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    const-string v4, "mpt"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 67
    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_0

    .line 70
    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    invoke-static {v3}, Lcom/glympse/platform/Platform;->ParseMpt(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    .line 73
    .local v0, astrMpt:[Ljava/lang/String;
    array-length v3, v0

    const/4 v4, 0x2

    if-lt v3, v4, :cond_0

    .line 75
    const/4 v3, 0x0

    aget-object v3, v0, v3

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->ParseDouble(Ljava/lang/String;)D

    move-result-wide v3

    iput-wide v3, p0, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    .line 76
    const/4 v3, 0x1

    aget-object v3, v0, v3

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->ParseDouble(Ljava/lang/String;)D

    move-result-wide v3

    iput-wide v3, p0, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    goto :goto_0

    .line 82
    .end local v0           #astrMpt:[Ljava/lang/String;
    :cond_2
    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    const-string v4, "lbl"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 84
    iget-object v3, v2, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    iput-object v3, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    .line 85
    iget-object v3, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;

    goto :goto_0

    .line 91
    :cond_3
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Unknown Place value: \""

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, v2, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ":"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v4, v2, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\""

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    goto/16 :goto_0
.end method

.method public Serialize(Ljava/lang/StringBuffer;)V
    .locals 5
    .parameter "strbuf"

    .prologue
    const/16 v4, 0x2c

    const/4 v3, 0x7

    .line 99
    invoke-virtual {p1}, Ljava/lang/StringBuffer;->length()I

    move-result v1

    if-lez v1, :cond_4

    const/4 v1, 0x1

    move v0, v1

    .line 102
    .local v0, fAppend:Z
    :goto_0
    invoke-virtual {p0}, Lcom/glympse/platform/common/Place;->HasLocation()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 104
    if-eqz v0, :cond_0

    invoke-virtual {p1, v4}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    :cond_0
    const/4 v0, 0x1

    .line 105
    const-string v1, "mpt:\""

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 106
    iget-wide v1, p0, Lcom/glympse/platform/common/Place;->m_dLatitude:D

    invoke-static {v1, v2, v3}, Lcom/glympse/platform/common/Helpers;->DoubleToStr(DI)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 107
    const-string v1, ","

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 108
    iget-wide v1, p0, Lcom/glympse/platform/common/Place;->m_dLongitude:D

    invoke-static {v1, v2, v3}, Lcom/glympse/platform/common/Helpers;->DoubleToStr(DI)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 109
    const-string v1, "\""

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 113
    :cond_1
    iget-object v1, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    .line 115
    if-eqz v0, :cond_2

    invoke-virtual {p1, v4}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    :cond_2
    const/4 v0, 0x1

    .line 116
    const-string v1, "lbl:\""

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 117
    iget-object v1, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->EncodeProtocolString(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/StringBuffer;)Ljava/lang/StringBuffer;

    .line 118
    const/16 v1, 0x22

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 120
    :cond_3
    return-void

    .line 99
    .end local v0           #fAppend:Z
    :cond_4
    const/4 v1, 0x0

    move v0, v1

    goto :goto_0
.end method

.method public toString()Ljava/lang/String;
    .locals 1

    .prologue
    .line 41
    iget-object v0, p0, Lcom/glympse/platform/common/Place;->m_strName:Ljava/lang/String;

    return-object v0
.end method
